package me.ezitku.base.extensions

import android.widget.TextView
import com.ug_project.views.content


fun TextView.checkContent(action: () -> Unit): Boolean {
    if (!content.isEmpty()) {
        action()
        return true
    } else {
        errAnim()
        return false
    }
}

fun Array<TextView>.checkContents(action: () -> Unit) {
    forEach {
        if (it.content.isEmpty()) {
            it.errAnim()
            return
        }
    }
    action()
}

fun TextView.clear() {
    this.content = ""
}